package com.minglead.crawler.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.minglead.crawler.util.SaveOrUpdateGroup;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.Size;
import java.util.Date;

/**
 * @description: 舆情基础信息表entity
 * @author: bxh
 * @date: 2024-8-1
 **/
@Data
@TableName("YQ_BASIC_INFO")
public class YqBasicInfoEntity extends BaseEntity {

    @Schema(description = "标题")
    @Size(max = 64, message = "标题 必须少于 64 个字符", groups = {SaveOrUpdateGroup.class})
    @TableField(value = "NAME")
    private String name;

    @Schema(description = "摘要，（前200字符，用于展示）")
    @TableField(value = "DIGEST")
    private String digest;

    @Schema(description = "正文详情ID，关联YQ_BASIC_INFO_DETAIL表")
    @TableField("DETAIL_ID")
    private String detailId;

    @Schema(description = "关键词，逗号连接")
    @TableField(value = "KEY_WORD")
    private String keyWord;

    @Schema(description = "媒体")
    @TableField(value = "MEDIA")
    private String media;

    @Schema(description = "热度")
    @TableField(value = "HOT")
    private Integer hot;

    @Schema(description = "所属行业，0:交通运输仓储邮政 1:住宿餐饮 2:信息软件 3:农业 4:制造业 5:卫生医疗 6:国际组织 7:建筑 8:房地产 9:政府组织 10:教育 11:文体娱乐 12:水利环境 13:电力燃气水生产 14:科学技术 15:租赁法律 16:采矿 17:金融")
    @TableField(value = "INDUSTRY")
    private Integer industry;

    @Schema(description = "所属行业概率")
    @TableField(value = "INDUSTRY_PVALUE")
    private Float industryPvalue;

    @Schema(description = "文章类型，0:财经 1:教育 2:房产 3:星座 4:科技 5:时尚 6:彩票 7:体育 8:游戏 9:时政 10:股票 11:娱乐 12:社会 13:家居")
    @TableField(value = "TYPE")
    private Integer type;

    @Schema(description = "文章类型概率")
    @TableField(value = "TYPE_PVALUE")
    private Float typePvalue;

    @Schema(description = "涉及城市")
    @TableField(value = "CITY")
    private String city;

    @Schema(description = "情感，0:正面，1:负面，2:中性(64以内)")
    @TableField(value = "SENTIMENT")
    private Integer sentiment;

    @Schema(description = "正面情感概率")
    @TableField(value = "POSITIVE_PVALUE")
    private Float positivePvalue;

    @Schema(description = "负面情感概率")
    @TableField(value = "NEGATIVE_PVALUE")
    private Float negativePvalue;

    @JsonFormat(pattern ="yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    @Schema(description = "发布时间")
    @TableField("PUBLISH_TIME")
    private Date publishTime;

    @Schema(description = "发布人昵称")
    @TableField(value = "PUBLISH_USER_NAME")
    private String publishUserName;

    @Schema(description = "来源URL")
    @TableField(value = "LINK")
    private String link;

    @Schema(description = "原始ID，用于去重")
    @TableField(value = "ORIGIN_ID")
    private String originId;
}
